package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.domain.User;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;


@Repository    //这里先继承BaseMapper
public interface UserMpper extends BaseMapper<User> {

    void update(User user);
    // 这里注意使用 查询的的时候会报多个错误

    @Select("select age, count(*) AS Total from tb_user group by age")
    List<Map<String,Object>> findCount();   //统计每个年龄对应的用户人数

}
